package com.miszczu.utils;

import java.util.HashMap;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

@Component
@Scope(value = "session", proxyMode = ScopedProxyMode.INTERFACES)
public class Messages implements MessagesIface {
	
	private HashMap<String, String> messages = new HashMap<String, String>();

	public String getMessage(String name) {
		
		return messages.get(name);
	}

	public void setMessage(String name, String value) {
		messages.put(name, value);
		
	}

	public void flush() {
		
		messages.clear();
		
	}
	

	
}
